<!-- eslint-disable prettier/prettier -->
<!-- eslint-disable @typescript-eslint/no-unused-vars -->
<!-- eslint-disable no-undef -->
<!-- eslint-disable @typescript-eslint/explicit-function-return-type -->
<script lang="ts" setup>
import { useUserStore } from '@renderer/store/user'
import { storeToRefs } from 'pinia'
import { useRoute } from 'vue-router'

// 当前路由对象
const route = useRoute();

// store对象
const userStore = useUserStore()

// 获取store暴露数据
const { count } = storeToRefs(userStore)

// 加
const jiaCount = ()=>{
  userStore.count +=1
}

// 减
const jianCount = ()=>{
  userStore.count -=1
}

</script>

<template>
  <div>
    <div>详情{{ route.query.id }}</div>
    <div>{{ count }}</div>
    <div @click="jiaCount">加1</div>
    <div @click="jianCount">减1</div>
  </div>
</template>
